import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import {HttpServies} from '../../providers/http-servies';
import {DetailsPage} from "../details/details";


@Component({
  selector: 'page-service',
  templateUrl: 'service.html',
  providers:[HttpServies]
})
export class ServicePage {

  dataJson:any=[];
  datasJson:any=[];

  constructor(public navCtrl: NavController, public navParams: NavParams,private http:HttpServies) {
  }

  ionViewDidLoad() {

    this.getsossokuan();
    this.getlfon();
  }
  detailsPage(category){
    this.navCtrl.push(DetailsPage,{category});
  }

  getsossokuan(){
    this.http.httpPost('/Home/job/civilians')
        .then(res => {//成功
          if (res && res.code == 1) {
            console.log(res.msg);
            this.dataJson = res.data;
          } else {
            this.http.showErro(res.msg);
          }
        })
  }
  getlfon(){
    this.http.httpPost('/Home/job/cards')
        .then(res => {//成功
          if (res && res.code == 1) {
            console.log(res.msg);
            this.datasJson = res.data;
          } else {
            this.http.showErro(res.msg);
          }
        })
  }


}
